import request from '@/utils/request'

export function getTeachplan() {
  return request({
    url: '/teachplan',
    method: 'get'
  })
}

export function createTeachPlan(data) {
  return request({
    url: '/teachplan/create',
    method: 'post',
    data
  })
}

export function getUpperList() {
  return request({
    url: '/teachplan/upperlist',
    method: 'get'
  })
}

export function getResourceList() {
  return request({
    url: '/teachplan/resourcelist',
    method: 'get'
  })
}

export function chooseResource(data) {
  return request({
    url: '/teachplan/chooseResource',
    method: 'post',
    data
  })
}

export function deleteTeachplan(id, grade) {
  return request({
    url: '/teachplan/delete',
    method: 'delete',
    params: { id, grade }
  })
}

export function getAnswer(data, teachplanId) {
  return request({
    url: '/teachplan/task',
    method: 'post',
    data,
    params: { teachplanId }
  })
}

export function scoring(answerId, score, studentId) {
  return request({
    url: '/teachplan/score',
    method: 'post',
    params: { answerId, score, studentId }
  })
}
